<template>
  <div>
    <div class="header">
    <div class="w">
      <div class="menu">
        <span class="oldSix">
            <img src="../../assets/svg/logo.png" alt="">
          </span>
        <el-menu
          :default-active="activeIndex"
          :router="true"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#394a40"
          text-color="#bbb"
          active-text-color="#fff"
        >
          
          <el-menu-item index="/">首页</el-menu-item>
          <el-menu-item index="/property">地产分类</el-menu-item>
          <el-menu-item index="/estateAgent">房产经纪</el-menu-item>
          <el-menu-item index="/about">关于我们 </el-menu-item>
        </el-menu>
        <slot name="before"></slot>
        <span class="loginBtn">
                <span class="iconAvater">
                  <img src="../../assets/svg/login_user.png" alt="" class="avater">
                </span>
                  <el-link type="primary" @click="loginBtn">登录</el-link>
                  <el-link type="primary" @click="registerFn">立即注册</el-link>
                  <el-link class="map">
                    <i class="el-icon-map-location 
"> 广州</i>
                  </el-link>
              </span>
      </div>
    </div>
     <ShowDialog :show-dialog.sync="isShow" ref="dialog"></ShowDialog>
  </div>
      <router-view />
  </div>
</template>

<script>
import ShowDialog from '@/components/components/showDialog.vue'
export default {
  components: {
    ShowDialog
  },
  data() {
    return {
      isShow: false,
      activeIndex: this.$route.path,
      navMenuList: [
        {
          title: "首页",
          path: "/",
        },
        {
          title: "地产分类",
          path: "/property",
        },
        {
          title: "房产经纪",
          path: "/estateAgent",
        },
        {
          title: "关于我们",
          path: "/about",
        },
      ],
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      this.activeIndex = key;
    },
    loginBtn(){
      this.isShow = true
    },
    registerFn(){
      this.isShow = true
      this.$refs.dialog.form=false
    }
  },
};
</script>

<style lang="scss" scoped>
/* 清内外边距 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* 设置版心 */
.w {
  width: 1226px;
  /* 版面居中 */
  margin: 0 auto;
  // background-color:#678574;
}

/* 头部 */
.header {
  color: rgb(113, 23, 23);
  position: relative;
  height: 60px;
  background-color: #394a40;
  // position: fixed;

  // margin-bottom: 10px;
}
.avater {
  width: 20px;
  height: 20px;
}
a{
  text-decoration: none;
}

.menu {
  // height: 100px;
  position: relative;
  width: 1226px;
  display: flex;
  font-weight: 700;
  justify-content: space-between;
  // position: fixed;
  ::v-deep .el-menu{
    margin-left: 100px;
  }
  .oldSix{
    position: absolute;
    height: 60px;
      margin-top: -5px;

    img{
      position: absolute;
      height: 60px;
      width: 100px;
      z-index: 990;
    }
  }
  .el-menu-item {
    width: 100px;
    text-align: center;
  }
  .loginBtn {
    display: flex;
    justify-content: flex-end;
    height: 60px;
    line-height: 60px;
    text-align: center;
    .map{
      width: 65px;
      height: 40px;
      bottom: -16%;
      background-color: rgba(0, 0, 0, 0.35);
      border-radius: 22px;
      z-index: 990;
    }
  }
  .el-link {
    color: #fff;
    margin: 0 10px;
  }
  .iconAvater {
    margin-top: 3px;
  }
}
</style>